package io.wdb.config;

import java.util.Properties;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.github.pagehelper.PageHelper;

@Configuration
public class MybatisPageHelperConfig {
	@Bean  
    public PageHelper pageHelper() {  
        PageHelper pageHelper = new PageHelper();  
        Properties p = new Properties();  
        p.setProperty("offsetAsPageNum", "false");  
        p.setProperty("rowBoundsWithCount", "false");  
        p.setProperty("reasonable", "false");  
        p.setProperty("rowBoundsWithCount", "false");
        p.setProperty("pageSizeZero", "false");
        p.setProperty("supportMethodsArguments", "false");
        p.setProperty("returnPageInfo", "none");
        p.setProperty("dialect","mysql");
        pageHelper.setProperties(p);  
        return pageHelper;  
    }  
}
